function [X,Y,grep,fvx,fvy,lvx,lvy,nx,ny,dx,dy,e,n,ve,vn,eve,evn,npe] = gs_gridload(filenin)
%
% === XY-GRID DATA LOADING  ===
%
%[X,Y,grep,fvx,fvy,lvx,lvy,nx,ny,dx,dy,e,n,ve,vn,eve,evn,npe] = gs_gridload('filenin')
%
% This function loads the data related to a regular grid already generated by 
% GS_GRIDGENE in a prevoius session of grid_strain program and stored in
% the file 'filenin'.
%
% See GS_GRIDGENE.

% G. Teza, 2005.

if nargin < 1, help gs_gridmod; error('Not enough input data'); end
if ischar(filenin) == 0, filenin = []; end 

format long e;

%--- available data loading ------------------------------------------------
[grep,fvx,fvy,lvx,lvy,nx,ny,dx,dy,e,n,ve,vn,eve,evn,npe] = ifok_load_kn(...
    filenin,'GRID FILE',...
    'grep','fvx','fvy','lvx','lvy','nx','ny','dx','dy',...
    'e','n','ve','vn','eve','evn','npe'); 
%---------------------------------------------------------------------------

grx = fvx:dx:lvx;         % See GS_GRIDGENE help
gry = fvy:dy:lvy;
[X,Y] = meshgrid(grx,gry);